<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Resources\Categories;
use App\Models\Category;
use App\Services\Api;
use Illuminate\Http\Request;

class CategoryController extends Controller
{
    /**
     * 分类列表
     */
    public function index(Request $request)
    {
        $category = Category::allCategory()->get();

        return Api::msg('api.category.index', Categories::collection($category));
    }
}
